<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="css/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="css/swiper-3.3.1.min.css"/>
		
		<style type="text/css">
			body,html{height: 100%;}
			#box{width: 640px;height: 100%;display: -webkit-box;-webkit-box-orient: vertical;}
			.header-top{width:100%;height:90px;position: relative;overflow: hidden;position: fixed;top: 0;}
			.car-shop{position: absolute;right: 35px;top: 24px;height: 50px;width: 104px;background:#c80f0d;border-radius: 14px 14px;}
			.top-middle{height: 90px;background: #a90506;position: relative;}
			.car-shop i{font-size: 40px;}
			.top-middle h2{text-align: center;line-height: 90px;color: #FFFFFF;font-size: 26px;}
			.foot{width:100%;position:fixed;bottom: 0;background: #a3a3a3;height: 100px;text-align: center;}
			.add-car{width: 436px;height: 80px;background: #b82221;line-height: 80px;margin:10px 0 0 100px;border-radius: 14px 14px;font-size: 25px;color: #fff;}
			.content{-webkit-box-flex: 1;margin-top: 90px;background: #f3eff0;}
			.img-detail img{height: 500px;}
			.img-detail{text-align: center;}
			.name-detail{padding-left: 20px;padding-top: 15px;}
			.name-detail p{line-height: 40px;display: block;}
		</style>
	</head>
	<body>
		<div id="box">
			<header class="header-top">
				<div class="top-middle">
					 <h2>商品详情</h2>
					 <button class="car-shop"><i class="iconfont">&#xe61b;</i></button>
			    
				</div>
			</header>
			<section class="content">
				<div class="name-detail"></div>
			</section>
			
		</div>
		
	</body>
	<script type="text/javascript" src="js/jquery-2.0.3.js"></script>
	<script type="text/javascript" src="js/shopcar.js"></script>
	<script type="text/javascript" src="js/swiper-3.3.1.jquery.min.js"></script>
	<script type="text/javascript">
	
	$(function(){
		var b=sessionStorage.getItem("goodsID")
		console.log(b)
	    $.ajax({
	    	type:'GET',
			url:'http://datainfo.duapp.com/shopdata/getGoods.php',
			dataType:'jsonp',
			data:{goodsID:b},
			success:function(data){
				$.each(data, function(index) {
					var oImg=$('<div class="img-detail"><img src="'+data[index].goodsListImg+'"></div>');
					
					 $(".content").prepend(oImg)
					var str=data[index].detail
					
					var str1=str.split("。")
					console.log(str1)
					$.each(str1, function(i) {
						console.log(str1[i])
						var p1='<p>'+str1[i]+'</p>'
						$(".name-detail").append(p1)
					});
					
				});
			}
	    })
		
	})
		function bodyScale(){
				var devicewidth=document.documentElement.clientWidth;
				var scale=devicewidth/640;
				document.body.style.zoom=scale;
			}
			window.onresize=window.onload=function(){
				bodyScale();
			}
	</script>
</html>
